from django.urls import path
from apps.lian.views import StudentViewSet  # 导入学生视图类
from apps.lian.views import ClassesViewSet  # 导入班级视图
from rest_framework.routers import SimpleRouter  # url 路由

#
urlpatterns = [
    # path('student/',StudentViewSet.as_view({'get':'list','post':'create'})),
    # path('student/<pk>/',StudentViewSet.as_view({'get':'retrieve','put':'update','delete':'destroy'})),

]

routers = SimpleRouter()  # 实例化一个路由器对象
routers.register('student', StudentViewSet)  # 注册路由路径
routers.register('classes', ClassesViewSet)  # 注册路由路径
urlpatterns += routers.urls  # 把注册路径添加到 urlpatterns 着个列表里面去
